﻿Public Class AnimationGeschütztreffer
    Inherits ObjektAnimation
    Const HalteFrame As Integer = 2
    Dim Zähler As Integer = 0
    ''' <summary>
    ''' 
    ''' </summary>
    ''' <param name="X"></param>
    ''' <param name="Y"></param>
    ''' <remarks></remarks>
    Public Sub New(ByVal X As Integer, ByVal Y As Integer, ByVal Musikspielen As Boolean, ByVal Schlacht As Integer)
        MyBase.New(Musikspielen, Schlacht)
        P.X = X
        P.Y = Y
        Frames = 7
        BildID = LoadTextur("SchwarzeGeschützfeuer", Frames)
        If Musikspielen = True Then
            MusikEngine.LoadWav(My.Settings.Resourcenpfad + "Sound\Explosion+Land.wav", False)
        End If
    End Sub
    Public Overrides Function Malen(ByVal intColor As System.Drawing.Color, Optional ByVal Zoomfaktor As Single = 1.0) As Boolean
        If MyBase.Malen(intColor, Zoomfaktor) Then
            Frame -= 1
        End If
        If HalteFrame <= Zähler Then
            Frame += 1
            Zähler = 0
        Else
            Zähler += 1
        End If

        If Frame > Frames Then
            Return False
        Else
            Return True
        End If
    End Function
End Class
